/**
 * 
 */
package org.arga.empresa.model.recruiting;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.arga.empresa.model.JobPosition;

/**
 * Object model for an applicant.
 * 
 * @author aflores@arga-inc.com
 * @since Jan 16, 2010 10:05:08 PM
 */
@Entity
@Table(name="applicants")
public class Applicant {
	private Long m_id;
	private String m_applicantNumber;
	private JobPosition m_jobPosition;
	
	/**
	 * Retrieves the id of this applicant.
	 * @return the id
	 */
	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	public Long getId() {
		return m_id;
	}
	
	/**
	 * Sets the id of this applicant.
	 * @param id the id to set
	 */
	public void setId(Long id) {
		m_id = id;
	}
	
	/**
	 * Retrieves the applicant number.
	 * @return the applicantNumber
	 */
	@Column(length=50, unique=true, nullable=false)
	public String getApplicantNumber() {
		return m_applicantNumber;
	}
	
	/**
	 * Sets the applicant number.
	 * @param applicantNumber the applicant number to set
	 */
	public void setApplicantNumber(String applicantNumber) {
		m_applicantNumber = applicantNumber;
	}
	
	/**
	 * Retrieves the position (job) of this employee.
	 * @return the jobPosition
	 */
	@ManyToOne(optional=false)
	@JoinColumn(name="jobPosition_id")
	public JobPosition getJobPosition() {
		return m_jobPosition;
	}
	
	/**
	 * Sets the job position.
	 * @param jobPosition the jobPosition to set
	 */
	public void setJobPosition(JobPosition jobPosition) {
		m_jobPosition = jobPosition;
	}
}
